﻿using Biotech.Utils;
using project.B12.IService;
using project.B12.Model.BaseModel;
using project.B12.Model.Enums;
using project.B12.Model.Models;
using software.Common.MVVM;
using software.dll.user;
using Software.Common.Util.AppConfig;
using System.Collections.ObjectModel;
using System.Windows;
using System.Xml.Linq;

namespace project.B12.Service.UserService
{
    public partial class UserService : ObservableObject, IUserService
    {
        #region Method
        /// <summary>
        /// 更新密码错误次数
        /// </summary>
        /// <returns></returns>
        public MessageModel UpdateLockedTime(int _LockedTimeConfig)
        {
            try
            {
                if (!IsAdmin())
                {
                    return MessageModel.ReturnFail("Insufficient permissions.");
                }
                UtilAppConfig.UpdateAppConfig("Login_LockedTime", _LockedTimeConfig.ToString());
                CurrentLockedTime = _LockedTimeConfig;
                return MessageModel.ReturnSuccess();
            }
            catch (Exception ex)
            {
                return MessageModel.ReturnFail(ex.ToString());//失败
            }
        }
        #endregion
    }
}
